package com.ld.wms.business.log.controller;


import com.ld.wms.business.approve.vo.resp.MaterialExampleInventoryApproveRespVo;
import com.ld.wms.business.log.service.InventoryOperateLogService;
import com.ld.wms.business.log.vo.resp.InventoryOperateLogRespVo;
import com.ld.wms.common.ResultResponse;
import com.ld.wms.common.vo.GeneratePageListVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 库存操作日志 前端控制器
 * </p>
 *
 * @author wangfeng
 * @since 2025-04-27
 */
@Slf4j
@Tag(name = "库存操作日志相关接口")
@RestController
public class InventoryOperateLogController {

    @Autowired
    private InventoryOperateLogService inventoryOperateLogService;

    @GetMapping("/api/wms/inventoryOperateLog/getPageList")
    @Operation(summary = "扭转日志(出库/入库/领取/。。。日志)")
    public ResultResponse<GeneratePageListVo<InventoryOperateLogRespVo>> getPageList(
            @Parameter(description = "类型Id") @RequestParam(required = false) Long materialTypeId,
            @Parameter(description = "物料/试剂,名称") @RequestParam(required = false) String materialExampleName,
            @Parameter(description = "casCode") @RequestParam(required = false) String casCode,
            @Parameter(description = "开始时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String startTime,
            @Parameter(description = "结束时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String endTime,
            @Parameter(description = "类型：0入库，1领取，2归还，3出库") @RequestParam(required = false) Integer type,
            @Parameter(description = "当前页数") @RequestParam(defaultValue = "1") Integer current,
            @Parameter(description = "每页展示条数") @RequestParam(defaultValue = "10") Integer size
    ) {
        GeneratePageListVo<InventoryOperateLogRespVo> pageList = inventoryOperateLogService.getPageList(type, current, size);
        return ResultResponse.success(pageList);
    }


}

